<template>
  <div>
    <el-card>
      <!-- 1.0 信息设置 -->
      <person-info></person-info>

      <!-- 2.0 推广链接和查询 -->
      <search />

      <!-- 3.0 账户列表 -->
      <Table :datatab="dataArr" />

      <!-- 分页 -->
      <el-pagination
        :current-page="pageNum"
        :page-sizes="[5, 10, 15, 20]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      ></el-pagination>
    </el-card>
  </div>
</template>

<script>
import PersonInfo from './components/PersonInfo.vue'
import Search from './components/Search.vue'
import Table from './components/Table.vue'

export default {
  components: {
    PersonInfo,
    Search,
    Table
  },
  data() {
    return {
      pageNum: 1,
      pageSize: 5,
      queryInfo: {
        accountLogType: 0,
        beginDate: 'string',
        endDate: 'string',
        keyword: 'string',
        sellerPhone: 'string',
        storeId: 0
      },
      dataArr: [],
      total: 0
    }
  },
  created() {
    this.getHistory()
  },
  methods: {
    async getHistory() {
      const { data } = await this._axios.post(
        `/seller/findsellerlogpagebyparam?page=${this.pageNum}&size=${this.pageSize}`,
        this.queryInfo
      )
      console.log(data)
      this.dataArr = data.dataList
      this.total = data.totalCount
    },
    handleSizeChange() {},
    handleCurrentChange() {}
  }
}
</script>

<style lang="scss" scoped>
.el-pagination {
  float: right;
  margin: 30px 0 50px;
  margin-right: 28px;
}
</style>
